<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>lacewing.server.ServerProtocol</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="lacewing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://mp2.dk">Python Lacewing Library</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="lacewing-module.html">Package&nbsp;lacewing</a> ::
        <a href="lacewing.server-module.html">Module&nbsp;server</a> ::
        Class&nbsp;ServerProtocol
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="lacewing.server.ServerProtocol-class.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== CLASS DESCRIPTION ==================== -->
<h1 class="epydoc">Class ServerProtocol</h1><p class="nomargin-top"><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol">source&nbsp;code</a></span></p>
<pre class="base-tree">
twisted.internet.protocol.BaseProtocol --+        
                                         |        
        twisted.internet.protocol.Protocol --+    
                                             |    
                         <a href="lacewing.protocol.BaseProtocol-class.html">protocol.BaseProtocol</a> --+
                                                 |
                                                <strong class="uidshort">ServerProtocol</strong>
</pre>

<hr />
<p>The server protocol.</p>

<!-- ==================== INSTANCE METHODS ==================== -->
<a name="section-InstanceMethods"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Methods</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#connectionMade" class="summary-sig-name">connectionMade</a>(<span class="summary-sig-arg">self</span>)</span><br />
      When a connection is made, a timeout timer is started, and if the 
      user does not request connection acceptance within reasonable time, 
      disconnect (to prevent flood attacks).</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.connectionMade">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#ping" class="summary-sig-name">ping</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">timeOut</span>=<span class="summary-sig-default">None</span>)</span><br />
      Ping the client with the given timeout.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.ping">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#connectionLost" class="summary-sig-name">connectionLost</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">reason</span>)</span><br />
      Once the connection is lost, put back the client ID into the pool, 
      and remove the client from all the channels it has signed on to.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.connectionLost">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#dataReceived" class="summary-sig-name">dataReceived</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">data</span>)</span><br />
      Called whenever data is received.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.dataReceived">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#loaderReceived" class="summary-sig-name">loaderReceived</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">loader</span>,
        <span class="summary-sig-arg">isDatagram</span>=<span class="summary-sig-default">False</span>)</span><br />
      Called when a packet is received.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.loaderReceived">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#sendLoader" class="summary-sig-name">sendLoader</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">loader</span>,
        <span class="summary-sig-arg">asDatagram</span>=<span class="summary-sig-default">False</span>)</span><br />
      Sends a packetloader to the client</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.sendLoader">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="disconnect"></a><span class="summary-sig-name">disconnect</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">response</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">*arg</span>,
        <span class="summary-sig-arg">**kw</span>)</span><br />
      Disconnect the the user for a specific reason.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.disconnect">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="warn"></a><span class="summary-sig-name">warn</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">response</span>,
        <span class="summary-sig-arg">warning</span>=<span class="summary-sig-default"><code class="variable-quote">'</code><code class="variable-string"></code><code class="variable-quote">'</code></span>,
        <span class="summary-sig-arg">name</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">channel</span>=<span class="summary-sig-default">None</span>)</span><br />
      Notify the client about a denial.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.warn">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#sendMessage" class="summary-sig-name">sendMessage</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">message</span>,
        <span class="summary-sig-arg">subchannel</span>,
        <span class="summary-sig-arg">channel</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">typeName</span>=<span class="summary-sig-default">None</span>,
        <span class="summary-sig-arg">asObject</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">asDatagram</span>=<span class="summary-sig-default">False</span>)</span><br />
      Send a direct message to the client.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.sendMessage">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#leaveChannel" class="summary-sig-name">leaveChannel</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channel</span>)</span><br />
      Remove the client from a specific channel.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.leaveChannel">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#joinChannel" class="summary-sig-name">joinChannel</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channelName</span>,
        <span class="summary-sig-arg">hidden</span>=<span class="summary-sig-default">False</span>,
        <span class="summary-sig-arg">autoClose</span>=<span class="summary-sig-default">False</span>)</span><br />
      Add the client to a new channel.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.joinChannel">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="setName"></a><span class="summary-sig-name">setName</span>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">name</span>)</span><br />
      Set the name of the client and notify it about it.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.setName">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#sendChannelList" class="summary-sig-name">sendChannelList</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channels</span>)</span><br />
      Sends a list of channels and their peer count to the other end of the
      connection.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.sendChannelList">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#connectionAccepted" class="summary-sig-name">connectionAccepted</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">welcome</span>)</span><br />
      Called when the server has accepted the requested connection.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.connectionAccepted">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#loginAccepted" class="summary-sig-name">loginAccepted</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">name</span>)</span><br />
      Called when the server has accepted the requested name.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.loginAccepted">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a name="channelListSent"></a><span class="summary-sig-name">channelListSent</span>(<span class="summary-sig-arg">self</span>)</span><br />
      Called after a requested channel list is sent.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.channelListSent">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#nameChanged" class="summary-sig-name">nameChanged</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">name</span>)</span><br />
      Called when the client changed name (after logging in).</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.nameChanged">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#messageReceived" class="summary-sig-name">messageReceived</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">message</span>)</span><br />
      Called when a client message arrives.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.messageReceived">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#channelMessageReceived" class="summary-sig-name">channelMessageReceived</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channel</span>,
        <span class="summary-sig-arg">message</span>)</span><br />
      Called when the client sends a channel message.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.channelMessageReceived">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#privateMessageReceived" class="summary-sig-name">privateMessageReceived</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channel</span>,
        <span class="summary-sig-arg">recipient</span>,
        <span class="summary-sig-arg">message</span>)</span><br />
      Called when the client has sent a private message</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.privateMessageReceived">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#channelJoined" class="summary-sig-name">channelJoined</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channel</span>)</span><br />
      Called when the client has joined a new channel.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.channelJoined">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#channelLeft" class="summary-sig-name">channelLeft</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channel</span>)</span><br />
      Called when the client has left a channel.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.channelLeft">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#pongReceived" class="summary-sig-name">pongReceived</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">latency</span>)</span><br />
      Called when a ping response has been received.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.pongReceived">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#masterActionExecuted" class="summary-sig-name">masterActionExecuted</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channel</span>,
        <span class="summary-sig-arg">peer</span>,
        <span class="summary-sig-arg">action</span>)</span><br />
      Called when after a master action has been executed.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.masterActionExecuted">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#acceptLogin" class="summary-sig-name">acceptLogin</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">name</span>)</span><br />
      Cancels the client login if False is returned.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptLogin">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#acceptNameChange" class="summary-sig-name">acceptNameChange</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">name</span>)</span><br />
      Cancels the client name change if False is returned.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptNameChange">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#acceptConnection" class="summary-sig-name">acceptConnection</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">welcome</span>)</span><br />
      Cancels the connection accept response if False is returned.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptConnection">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#acceptChannelMessage" class="summary-sig-name">acceptChannelMessage</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channel</span>,
        <span class="summary-sig-arg">message</span>)</span><br />
      Cancels the channel message if False is returned.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptChannelMessage">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#acceptPrivateMessage" class="summary-sig-name">acceptPrivateMessage</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channel</span>,
        <span class="summary-sig-arg">recipient</span>,
        <span class="summary-sig-arg">message</span>)</span><br />
      Cancels the private message if False is returned.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptPrivateMessage">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#acceptChannelListRequest" class="summary-sig-name">acceptChannelListRequest</a>(<span class="summary-sig-arg">self</span>)</span><br />
      Cancels the sending of the channel list if False is returned.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptChannelListRequest">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#acceptChannelJoin" class="summary-sig-name">acceptChannelJoin</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channelName</span>)</span><br />
      Cancels the channel join accept response if False is returned.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptChannelJoin">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#acceptChannelLeave" class="summary-sig-name">acceptChannelLeave</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channel</span>)</span><br />
      Cancels the channel leave accept response if False is returned.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptChannelLeave">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">bool</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="lacewing.server.ServerProtocol-class.html#acceptMasterAction" class="summary-sig-name">acceptMasterAction</a>(<span class="summary-sig-arg">self</span>,
        <span class="summary-sig-arg">channel</span>,
        <span class="summary-sig-arg">peer</span>,
        <span class="summary-sig-arg">action</span>)</span><br />
      Cancels a master action if False is returned.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptMasterAction">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lacewing.protocol.BaseProtocol-class.html">protocol.BaseProtocol</a></code></b>:
      <code><a href="lacewing.protocol.BaseProtocol-class.html#validName">validName</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>twisted.internet.protocol.Protocol</code></b>:
      <code>__provides__</code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>twisted.internet.protocol.BaseProtocol</code></b>:
      <code>__providedBy__</code>,
      <code>makeConnection</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== CLASS VARIABLES ==================== -->
<a name="section-ClassVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Class Variables</span></td>
</tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lacewing.protocol.BaseProtocol-class.html">protocol.BaseProtocol</a></code></b>:
      <code><a href="lacewing.protocol.BaseProtocol-class.html#revision">revision</a></code>,
      <code><a href="lacewing.protocol.BaseProtocol-class.html#udpEnabled">udpEnabled</a></code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>twisted.internet.protocol.Protocol</code></b>:
      <code>__implemented__</code>
      </p>
    <p class="indent-wrapped-lines"><b>Inherited from <code>twisted.internet.protocol.BaseProtocol</code></b>:
      <code>connected</code>,
      <code>transport</code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== INSTANCE VARIABLES ==================== -->
<a name="section-InstanceVariables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Instance Variables</span></td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="latency"></a><span class="summary-name">latency</span> = <code title="None">None</code><br />
      The latency between the server and client.
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="datagramPort"></a><span class="summary-name">datagramPort</span> = <code title="None">None</code><br />
      The UDP port that the connection sends/receives data on.
    </td>
  </tr>
  <tr>
    <td colspan="2" class="summary">
    <p class="indent-wrapped-lines"><b>Inherited from <code><a href="lacewing.protocol.BaseProtocol-class.html">protocol.BaseProtocol</a></code></b>:
      <code><a href="lacewing.protocol.BaseProtocol-class.html#channels">channels</a></code>,
      <code><a href="lacewing.protocol.BaseProtocol-class.html#id">id</a></code>,
      <code><a href="lacewing.protocol.BaseProtocol-class.html#isAccepted">isAccepted</a></code>,
      <code><a href="lacewing.protocol.BaseProtocol-class.html#loggedIn">loggedIn</a></code>,
      <code><a href="lacewing.protocol.BaseProtocol-class.html#name">name</a></code>,
      <code><a href="lacewing.protocol.BaseProtocol-class.html#privateAllowed">privateAllowed</a></code>
      </p>
    </td>
  </tr>
</table>
<!-- ==================== METHOD DETAILS ==================== -->
<a name="section-MethodDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td align="left" colspan="2" class="table-header">
    <span class="table-header">Method Details</span></td>
</tr>
</table>
<a name="connectionMade"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">connectionMade</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.connectionMade">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>When a connection is made, a timeout timer is started, and if the user
  does not request connection acceptance within reasonable time, disconnect
  (to prevent flood attacks).</p>
  <dl class="fields">
    <dt>Overrides:
        twisted.internet.protocol.BaseProtocol.connectionMade
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="ping"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">ping</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">timeOut</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.ping">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Ping the client with the given timeout.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>timeOut</code></strong> - The number of seconds the client has to respond to the ping.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="connectionLost"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">connectionLost</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">reason</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.connectionLost">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Once the connection is lost, put back the client ID into the pool, and
  remove the client from all the channels it has signed on to.</p>
  <dl class="fields">
    <dt>Overrides:
        twisted.internet.protocol.Protocol.connectionLost
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="dataReceived"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">dataReceived</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">data</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.dataReceived">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called whenever data is received.</p>
  <p>Use this method to translate to a higher-level message.  Usually, some
  callback will be made upon the receipt of each complete protocol 
  message.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>data</code></strong> - a string of indeterminate length.  Please keep in mind that you 
          will probably need to buffer some data, as partial (or multiple) 
          protocol messages may be received!  I recommend that unit tests 
          for protocols call through to this method with differing chunk 
          sizes, down to one byte at a time.</li>
    </ul></dd>
    <dt>Overrides:
        twisted.internet.protocol.Protocol.dataReceived
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="loaderReceived"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">loaderReceived</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">loader</span>,
        <span class="sig-arg">isDatagram</span>=<span class="sig-default">False</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.loaderReceived">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called when a packet is received.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>isDatagram</code></strong> - True if the message recieved was sent using UDP.</li>
    </ul></dd>
    <dt>Overrides:
        <a href="lacewing.protocol.BaseProtocol-class.html#loaderReceived">protocol.BaseProtocol.loaderReceived</a>
        <dd><em class="note">(inherited documentation)</em></dd>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="sendLoader"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">sendLoader</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">loader</span>,
        <span class="sig-arg">asDatagram</span>=<span class="sig-default">False</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.sendLoader">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Sends a packetloader to the client</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>loader</code></strong> - The packetloader to send.</li>
        <li><strong class="pname"><code>asDatagram</code></strong> - True if the packet should be sent as a datagram packet</li>
    </ul></dd>
    <dt>Overrides:
        <a href="lacewing.protocol.BaseProtocol-class.html#sendLoader">protocol.BaseProtocol.sendLoader</a>
    </dt>
  </dl>
</td></tr></table>
</div>
<a name="sendMessage"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">sendMessage</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">message</span>,
        <span class="sig-arg">subchannel</span>,
        <span class="sig-arg">channel</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">typeName</span>=<span class="sig-default">None</span>,
        <span class="sig-arg">asObject</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">asDatagram</span>=<span class="sig-default">False</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.sendMessage">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Send a direct message to the client.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>subchannel</code></strong> - The subchannel of the message in the range 0-256</li>
        <li><strong class="pname"><code>typeName</code></strong> - If not specified, the type will be automatically detected (see <a
          href="lacewing.packetloaders.common-module.html#DATA_TYPES" 
          class="link">lacewing.packetloaders.common.DATA_TYPES</a> for 
          possible values)</li>
        <li><strong class="pname"><code>message</code></strong> (str/number/ByteReader)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="leaveChannel"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">leaveChannel</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channel</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.leaveChannel">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Remove the client from a specific channel.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>channel</code></strong> (ServerChannel object) - The channel to remove the client from.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="joinChannel"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">joinChannel</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channelName</span>,
        <span class="sig-arg">hidden</span>=<span class="sig-default">False</span>,
        <span class="sig-arg">autoClose</span>=<span class="sig-default">False</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.joinChannel">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Add the client to a new channel. If the channel does not already 
  exist, it is created.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>hidden</code></strong> - If this connection is creating the channel, this will hide it 
          from channel listing</li>
        <li><strong class="pname"><code>autoClose</code></strong> - If this connection is creating the channel, this will close the 
          channel when the connection leaves</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="sendChannelList"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">sendChannelList</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channels</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.sendChannelList">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Sends a list of channels and their peer count to the other end of the 
  connection.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>channels</code></strong> - List of 2-item tuples (channelName, peerCount)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="connectionAccepted"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">connectionAccepted</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">welcome</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.connectionAccepted">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called when the server has accepted the requested connection.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>welcome</code></strong> (<a href="lacewing.packetloaders.client.Request-class.html" 
          class="link">client.Request</a> object)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="loginAccepted"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">loginAccepted</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">name</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.loginAccepted">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called when the server has accepted the requested name.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>name</code></strong> (str object) - The name of the client.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="nameChanged"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">nameChanged</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">name</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.nameChanged">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called when the client changed name (after logging in).</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>name</code></strong> (str) - The name the client has changed to.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="messageReceived"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">messageReceived</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">message</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.messageReceived">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called when a client message arrives.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>message</code></strong> (<a 
          href="lacewing.packetloaders.client.BinaryServerMessage-class.html"
          class="link">client.BinaryServerMessage</a> or <a 
          href="lacewing.packetloaders.client.ObjectServerMessage-class.html"
          class="link">client.ObjectServerMessage</a>)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="channelMessageReceived"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">channelMessageReceived</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channel</span>,
        <span class="sig-arg">message</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.channelMessageReceived">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called when the client sends a channel message.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>channel</code></strong> - the channel the user is sending to.</li>
        <li><strong class="pname"><code>message</code></strong> (<a 
          href="lacewing.packetloaders.client.BinaryChannelMessage-class.html"
          class="link">client.BinaryChannelMessage</a> or <a 
          href="lacewing.packetloaders.client.ObjectChannelMessage-class.html"
          class="link">client.ObjectChannelMessage</a>)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="privateMessageReceived"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">privateMessageReceived</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channel</span>,
        <span class="sig-arg">recipient</span>,
        <span class="sig-arg">message</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.privateMessageReceived">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called when the client has sent a private message</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>channel</code></strong> - the channel the user is sending from.</li>
        <li><strong class="pname"><code>message</code></strong> (<a 
          href="lacewing.packetloaders.client.BinaryPeerMessage-class.html"
          class="link">client.BinaryPeerMessage</a> or <a 
          href="lacewing.packetloaders.client.ObjectPeerMessage-class.html"
          class="link">client.ObjectPeerMessage</a>)</li>
        <li><strong class="pname"><code>recipient</code></strong> (<a href="lacewing.server.ServerProtocol-class.html" 
          class="link">ServerProtocol</a> object)</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="channelJoined"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">channelJoined</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channel</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.channelJoined">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called when the client has joined a new channel.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>channel</code></strong> - The channel the client has joined.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="channelLeft"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">channelLeft</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channel</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.channelLeft">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called when the client has left a channel.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>channel</code></strong> - The channel the client has left.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="pongReceived"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">pongReceived</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">latency</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.pongReceived">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called when a ping response has been received.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>latency</code></strong> - Round-trip time in seconds between the client and the server.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="masterActionExecuted"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">masterActionExecuted</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channel</span>,
        <span class="sig-arg">peer</span>,
        <span class="sig-arg">action</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.masterActionExecuted">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Called when after a master action has been executed.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>channel</code></strong> - The channel the action took place in</li>
        <li><strong class="pname"><code>peer</code></strong> - The peer the action was executed on</li>
        <li><strong class="pname"><code>action</code></strong> (Currently, only {pylacewing.constants.MASTER_KICK}) - The action the master requested</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="acceptLogin"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">acceptLogin</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">name</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptLogin">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Cancels the client login if False is returned. Useful if the server 
  specifies client names.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>name</code></strong> - The requested client name.</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>Return False to cancel client login.</dd>
  </dl>
</td></tr></table>
</div>
<a name="acceptNameChange"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">acceptNameChange</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">name</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptNameChange">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Cancels the client name change if False is returned. Useful if the 
  server specifies client names.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>name</code></strong> - The requested client name.</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>Return False to cancel name change.</dd>
  </dl>
</td></tr></table>
</div>
<a name="acceptConnection"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">acceptConnection</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">welcome</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptConnection">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Cancels the connection accept response if False is returned. Useful 
  for banning.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>welcome</code></strong> (<a href="lacewing.packetloaders.client.Request-class.html" 
          class="link">client.Request</a> object)</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>Return False to cancel connection acceptance.</dd>
  </dl>
</td></tr></table>
</div>
<a name="acceptChannelMessage"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">acceptChannelMessage</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channel</span>,
        <span class="sig-arg">message</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptChannelMessage">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Cancels the channel message if False is returned. Useful for blocking 
  invalid messages.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>message</code></strong> (<a 
          href="lacewing.packetloaders.client.BinaryChannelMessage-class.html"
          class="link">client.BinaryChannelMessage</a> or <a 
          href="lacewing.packetloaders.client.ObjectChannelMessage-class.html"
          class="link">client.ObjectChannelMessage</a>)</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>Return False to stop the channel message before it is sent.</dd>
  </dl>
</td></tr></table>
</div>
<a name="acceptPrivateMessage"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">acceptPrivateMessage</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channel</span>,
        <span class="sig-arg">recipient</span>,
        <span class="sig-arg">message</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptPrivateMessage">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Cancels the private message if False is returned. Useful for blocking 
  invalid messages.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>channel</code></strong> - the channel the user sending from.</li>
        <li><strong class="pname"><code>message</code></strong> (<a 
          href="lacewing.packetloaders.client.BinaryPeerMessage-class.html"
          class="link">client.BinaryPeerMessage</a> or <a 
          href="lacewing.packetloaders.client.ObjectPeerMessage-class.html"
          class="link">client.ObjectPeerMessage</a>)</li>
        <li><strong class="pname"><code>recipient</code></strong> (<a href="lacewing.server.ServerProtocol-class.html" 
          class="link">ServerProtocol</a> object)</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>Return False to stop the channel message before it is sent.</dd>
  </dl>
</td></tr></table>
</div>
<a name="acceptChannelListRequest"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">acceptChannelListRequest</span>(<span class="sig-arg">self</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptChannelListRequest">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Cancels the sending of the channel list if False is returned. Useful 
  for servers with a strict policy.</p>
  <dl class="fields">
    <dt>Returns: bool</dt>
        <dd>Return False to send no channel list.</dd>
  </dl>
</td></tr></table>
</div>
<a name="acceptChannelJoin"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">acceptChannelJoin</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channelName</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptChannelJoin">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Cancels the channel join accept response if False is returned. Useful 
  for channel-less servers.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>channelName</code></strong> - The name of the channel.</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>Return False to cancel channel join acceptance.</dd>
  </dl>
</td></tr></table>
</div>
<a name="acceptChannelLeave"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">acceptChannelLeave</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channel</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptChannelLeave">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Cancels the channel leave accept response if False is returned. Useful
  if the client may not leave the current channel.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>channel</code></strong> - The channel the client is leaving.</li>
    </ul></dd>
    <dt>Returns: bool</dt>
        <dd>Return False to cancel channel join acceptance.</dd>
  </dl>
</td></tr></table>
</div>
<a name="acceptMasterAction"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">acceptMasterAction</span>(<span class="sig-arg">self</span>,
        <span class="sig-arg">channel</span>,
        <span class="sig-arg">peer</span>,
        <span class="sig-arg">action</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="lacewing.server-pysrc.html#ServerProtocol.acceptMasterAction">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Cancels a master action if False is returned. Useful for blocking some
  specific master actions.</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>channel</code></strong> - The channel the action is taking place in.</li>
        <li><strong class="pname"><code>peer</code></strong> - The peer this action is executed on.</li>
        <li><strong class="pname"><code>action</code></strong> (Currently, only {pylacewing.constants.MASTER_KICK}) - The action the master has requested.</li>
    </ul></dd>
    <dt>Returns: bool</dt>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="lacewing-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="http://mp2.dk">Python Lacewing Library</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Dec 22 06:19:59 2011
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
